package net.neptech.repository;

import net.neptech.model.order.OrderMaster;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface OrderRepository extends JpaRepository<OrderMaster, Long> {




    @Transactional
    @Modifying
    @Query("update OrderMaster o set o.status = ?1")
    int updateStatusBy(Byte status);

    @Transactional
    @Modifying
    @Query("update OrderMaster o set o.id = ?1, o.status = ?2 where o.id = ?3")
    int updateIdAndStatusById(Long id, Byte status, Long id1);

    @Transactional
    @Modifying
    @Query("update OrderMaster o set o.status = ?1 where o.id = ?2")
    int updateStatusById(Byte status, Long id);
}
